﻿using Devices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XiaonuanPMS.Logic;

namespace XiaonuanPMS.Entity
{
    public class RPTestPetInfo
    {
        public int PetID { get; set; }
        
        public string orgCode { get; set; }
        
        public string petName { get; set; }

        public string gender { get; set; }
        public GenderType GenderType
        {
            get => (gender == "pm" || gender == "pmc")? GenderType.Male: GenderType.Female;
        }
        
        public DateTime? Birthdate { get => DateTime.Parse(birthdate); }
        public string birthdate
        {
            get;set;
        }
        public string weight { get; set; }
        public string petBreed { get; set; }
        public string KindOF { get; set; }
        
        public string variety { get; set; }
        
        public long customerId { get; set; }
        
        public string customerName { get; set; }

        public string oldMedRecordNo { get; set; }

        public Devices.KindOfType KindOfType
        {
            get {
                switch (KindOF)
                {
                    case "dog":
                        return Devices.KindOfType.犬;
                    case "cat":
                        return Devices.KindOfType.猫;
                    default:
                        return RuipaiYicong.GetKindOfType(petBreed);
                }

            } 
        }
    }
}
